<div class="masker"></div>
    <div class="wrapper">
        <script src="__ROOT__/shiwen/pc/xin/js/aixin.js"></script>

<div class="headerwrap">
        <div id="header">
            <div class="logo"><a href="/"><img src="__ROOT__/shiwen/pc/xin/picture/xlogo.png" alt="好诗文网"></a></div>
            <div class="menu">
                <ul>
                     <li class="channels" style="width:400px">
                    {volist name="categorys" id="vo"}
                        <a href="/nav_list/{$vo.cid}.html" target="_blank">{$vo.name}</a>
                    {/volist}
                        <a href="/love.html" target="_blank">三行情诗</a>
                    </li>
                    {if session('?member')}
                    <li class="channels" style="position:relative;top:-40px;right:-355px;">
                        <a href="#" rel="nofollow">
                            <u>
                                <em id="set">
                                    <a href="/home" target="_blank">{:session('member.nickname')}主页</a>
                                    <a href="javascript:void(0);" onclick="logout()">退出</a>
                                </em>
                            </u>
                            <i></i>
                        </a>
                    </li>
                    {else /}
                        <li class="nologin">
                            <a href="/qq_login" rel="nofollow">QQ账号登陆</a>|
                            <a href="javascript:void(0);" onclick="login()" rel="nofollow">用户名登录</a>
                        </li>
                    {/if}
                    
                </ul>
            </div>
        </div>
</div>
<style>
label{color:#666;}
a{color:#336699; text-decoration:none;}
a:hover{color:red;}
#login,#reg{margin-left:auto; margin-right:auto; margin-top:150px; width:300px; border:1px solid #eee; background:#fff; padding:30px;position:fixed;;left:40%;top:8%;z-index:9999;display:none;}
input.txt{width:230px; padding:8px 5px; border:1px solid #ddd;}
input.submit{ border:1px solid #ff8800; padding:5px 15px; color:#fff; background:#ff8800;}
</style>
<div id="login">
            <div><label>用户名：</label><input name="username" id="name" class="txt"></div>
            <div style="margin-top:15px;"><label>密&nbsp;&nbsp;&nbsp;码：</label><input name="password" class="txt" id="password" type="password"></div>
            <div style="margin-top:15px; text-align:right;"><a href="show.html">使用QQ登录</a><a href="javascript:void(0);" onclick="reg()">或注册</a><input type="submit" value="登录" class="submit login"></div>
</div>

<div id="reg">
            <div><label>用户名：</label><input name="username" id="nickname" class="txt"></div>
            <div style="margin-top:15px;"><label>密&nbsp;&nbsp;&nbsp;码：</label><input class="txt" id="pwd" type="password"></div>
            <div style="margin-top:15px; text-align:right;"><a href="javascript:void(0);" onclick="login()">登录</a><input type="submit" value="注册" class="submit reg"></div>
</div>
<script>
    function login(){
        $(".masker").show();
        $("#login").show();
        $("#reg").hide();
    }
    function logout(){
        $.ajax({
            url: "/logout.html",
            type: "POST",
            data: {},
            dataType: "json",
            success: function(msg) {
                if (msg.code == 200) {
                    swal("Good!", msg.msg, "success");
                    setTimeout(function(){
                        window.location.reload();
                    },1000);
                } else {
                    swal("OMG!", '客官,这货不肯走啊!!!', "error");
                }
            },
            error: function(xhr, status, error) {
                swal("OMG!", msg.msg, "error");
            }
        });
    }
    
    //显示注册
    function reg(){
        $("#login").hide();
        $("#reg").show();
    }
</script>